Hi Frank,
KFLOP User programs launched from Spindle Commands or NotifyPlugins() calls are non-blocking. They simply launch the User Program or possibly even queue them to be launched later if the thread is not available. If we blocked the call until the program finished Mach3 would freeze until we returned which usually would be a bad thing.
The only solution I can think of would require you to add an M code VB macro after each S command. You could then assign VB code to that Macro to loop sleeping until your input bit comes on. You would need to configure the IO 143 as a Mach3 Input. (Note that in Mach3 for KFLOP IO numbers greater than or equal to 128 - subtract 128 and specify port #2 instead of #1)
Does that work for you?
Rergards
TK